<template>
	<div class="view">
		<!-- 头部 -->
		<template>
			<Top title="操作日志"></Top>
		</template>
		<!-- 头部 end -->


		<!-- 主体部分 -->
		<div class="main">
			<div class="main_con" :style="{height:conheight+'px'}">
				<div class="item_box">
					<div class="box_top">
						<div class="box_title">操作日志</div>
					</div>
					<div class="item" v-for="(item,index) in dataList" :key="index">
						<div class="item_title">{{item.title}}</div>
						<div class="item_time">{{item.timeCreate}}</div>
					</div>
					<div class="item_page">
						<el-pagination background layout="prev, pager, next, jumper" :page-size="limit" :current-page="current"
							:total="total" @current-change="handleCurrentChange">
						</el-pagination>
					</div>
				</div>
			</div>
		</div>
		<!-- 主体部分 end -->

		<!-- 尾部 -->

		<!-- 尾部 end -->

	</div>
</template>

<script>
	import Top from "../components/top.vue"
	export default {
		components:{
			Top
		},
		data() {
			return {
				conheight: document.documentElement.clientHeight - 147,
				total: 0,
				limit: 10,
				current: 1,
				dataList: [],
			}
		},
		created() {
			this.getData(this.current);
		},
		methods: {
			dataInit(){
				this.$http({
					url:this.$api.log,
					'method':'post',
					data:{
						current:this.current,
						limit:this.limit
					}
				}).then(res =>{
					if(res.data.code==20000){
						this.dataList = res.data.data.row;
						this.total = res.data.data.total
					}else{
						this.$message.error(res.data.message)
					}
				})
			},

			// 分页
			handleCurrentChange(num){
				this.current = num;
				this.dataInit()
			}
		},
		created(){
			this.dataInit()
		}
	}
</script>

<style scoped>
	@import url("../assets/css/log.css");
	.h_user *{
		cursor: pointer;
	}
</style>
